package com.zy.datareceiver.core.common;

import java.util.Optional;

public class Tuple4<A,B,C,D> extends Tuple {

    private A a;
    private B b;
    private C c;
    private D d;

    public Tuple4(A a, B b, C c, D d){
        this.a = a;
        this.b = b;
        this.c = c;
        this.d = d;
    }
    @Override
    public <A> Optional _1() {
        return Optional.ofNullable(a);
    }

    @Override
    public <B> Optional _2() {
        return Optional.ofNullable(b);
    }

    @Override
    public <C> Optional _3() {
        return Optional.ofNullable(c);
    }

    @Override
    public <D> Optional _4() {
        return Optional.ofNullable(d);
    }

    @Override
    public <E> Optional<E> _5() {
        return Optional.empty();
    }
}
